import Vue from "vue"
import Vuex from 'vuex'

Vue.use(Vuex)

const loadingM = {
    namespaced: true,
    state: {
        requesting: false
    },
    mutations: {
        showLoading(state){
            state.requesting = true    
        },
        hideLoading (state) {
            state.requesting = false
        }
    },
    getters: {
        getLoadState: state =>{
            return state.requesting
        }
    }
}



// store.js
const store = new Vuex.Store({
    modules: {
        loadingM
    }
})

export default store